diff options
| author | real-zephex <[email protected]> | 2024-04-06 15:38:39 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-06 15:38:39 +0530 |
| commit | 99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3 (patch) | |
| tree | e5ea8e64e27778ce468431138775bf9f6dc3874b /src/app/anime/[id]/[...animeId] | |
| parent | UI Upgrades for anime section. (diff) | |
| parent | added search functionality (diff) | |
| download | dramalama-99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3.tar.xz dramalama-99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3.zip | |
Merge pull request #2 from real-zephex/kdrama-section-rewrite
The kdrama section underwent a complete rewrite.
Diffstat (limited to 'src/app/anime/[id]/[...animeId]')
| -rw-r--r-- | src/app/anime/[id]/[...animeId]/page.jsx | 13 | ||||
| -rw-r--r-- | src/app/anime/[id]/[...animeId]/video.module.css | 7 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/app/anime/[id]/[...animeId]/page.jsx b/src/app/anime/[id]/[...animeId]/page.jsx index 966f212..950f618 100644 --- a/src/app/anime/[id]/[...animeId]/page.jsx +++ b/src/app/anime/[id]/[...animeId]/page.jsx @@ -10,6 +10,7 @@ import { redirect } from "next/navigation"; import Link from "next/link"; export default async function Video({ params }) { + let link; const id = params.animeId[0]; const series = params.animeId[1]; @@ -25,7 +26,16 @@ export default async function Video({ params }) { redirect("/404"); } - const link = data.sources[4].url; + try { + link = data.sources[4].url; + } catch (error) { + try { + link = data.sources[3].url; + } catch (error) { + console.log("Episode not found."); + redirect("/404"); + } + } return ( <div className={styles.VideoMain}> @@ -37,7 +47,6 @@ export default async function Video({ params }) { <MediaPlayer title={words} src={link} - playsInline aspectRatio="16/9" load="eager" className={styles.VideoPlayer} diff --git a/src/app/anime/[id]/[...animeId]/video.module.css b/src/app/anime/[id]/[...animeId]/video.module.css index d947fc3..0214e60 100644 --- a/src/app/anime/[id]/[...animeId]/video.module.css +++ b/src/app/anime/[id]/[...animeId]/video.module.css @@ -1,8 +1,3 @@ -.VideoMain { - max-width: 98%; - margin: 0px auto; -} - .Video { display: flex; justify-content: center; @@ -11,7 +6,7 @@ .VideoPlayer { border-radius: 10px; - width: 75%; + width: 70%; height: auto; } |